{include file="common/header"/}
<link rel="stylesheet" href="/static/admin/spectrum/spectrum.css">
<style>
    .edui-editor{z-index: 1!important;}
</style>
<script type="text/javascript" charset="utf-8" src="/static/plugins/UEditor/ueditor.config.js"></script>

<script type="text/javascript" charset="utf-8" src="/static/plugins/UEditor/ueditor.all.js"> </script>

<script type="text/javascript" charset="utf-8" src="/static/plugins/UEditor/lang/zh-cn/zh-cn.js"></script>

<script type="text/javascript" charset="utf-8" src="/static/plugins/UEditor/ZeroClipboard.min.js"></script>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form layui-form-pane" lay-filter="form">
                        <div class="layui-form-item">
                        <label class="layui-form-label">栏目</label>
                            <div class=" layui-input-inline ">
                                <select id="catid" lay-verify="required" name="catid" title="必须选择一个栏目">
                                    <option value="">请选择栏目</option>
                                    {volist name='categorys' id='vo'}
                                    <option value="{$vo.id}" {if !empty($info) && $info.catid==$vo.id} selected {/if} >{$vo.ltitle}</option>
                                    {/volist}
                                </select>
                            </div>
                            <div class="layui-form-mid layui-word-aux red">*必填</div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">标题</label>
                            <div class=" layui-input-inline">
                                <input type="text" name="title" lay-verify="required" placeholder="请输入标题" class="layui-input"> 
                            </div>
                            <div class="layui-form-mid layui-word-aux red">*必填</div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">标题颜色</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" name="style_color" id="style_color" style="display: none;">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">加粗</label>
                            <div class="layui-input-inline">
                                <input type="checkbox" name="style_bold" value="bold" title="加粗">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">缩略图</label>
                            <div class="layui-input-inline">
                                <input type="hidden" name="image" id="thumb" class="attach">
                                <div class="layui-upload">
                                    <button type="button" class="layui-btn layui-btn-primary" id="selectAttach" data-href="{:url('sys.attach/select')}?mime=image"><i class="icon icon-upload3"></i>选择</button>
                                    <div class="layui-upload-list">
                                        <img class="layui-upload-img" style="width:120px;max-height:100px;" src="" title="">
                                        <p id="thumbText"></p>
                                    </div>
                                </div>                                
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">SEO标题</label>
                            <div class=" layui-input-inline">
                                <input type="text" name="seotitle" placeholder="请输入SEO标题" class="layui-input"> 
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">关键词</label>
                            <div class=" layui-input-inline">
                                <input type="text" name="keywords" placeholder="请输入关键词" class="layui-input"> 
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">SEO简介</label>
                            <div class=" layui-input-inline">
                                <textarea name="description" placeholder="请输入SEO简介" class="layui-textarea"></textarea>
                            </div>
                        </div>
                        <div id="extend"></div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">详  情</label>
                            <div class="layui-input-block">
                                <script id="ueditor_content" name="content" type="text/plain" style="width:98%; height:500px;"></script>
                                <script type="text/javascript">var ue = UE.getEditor('ueditor_content');</script>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">状态</label>
                            <div class=" layui-input-inline ">
                                <input name="status" checked value="normal" type="radio" class="ace" title="正常">
                                <input name="status" value="hidden" type="radio" class="ace" title="隐藏">                                  
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="id"  >
                                <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('submit')}</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>


{include file="common/footer"/}
<script src='/static/admin/spectrum/spectrum.js'></script>
<script>
$(function(){
    $("#style_color").spectrum({
        showPaletteOnly: true,
        showPalette:true,
        hideAfterPaletteSelect:true,
        palette: [
            ['#FF5722','#5FB878','#1E9FFF','#F7B824'],
            ['#666666','#000000','#999933','#CCFF00'],
            ['#FF9900','#333399','#009966','#FF33CC']
        ]
    });
})
</script>
<script>
layui.use(['form'], function () {
    var form = layui.form;

    info = {:json_encode($info)};
    form.val("form", info);
    if(info){
        $('#addPic').attr('src',info.avatar);
    }

    form.render();

});



</script>